var e = require("../../@babel/runtime/helpers/objectSpread2"),
  n = require("@/utils/jump"),
  t = c(require("../../config/index")),
  a = c(require("../../config/page")),
  i = require("@/services/user-service"),
  o = require("@/utils/report");
function c(e) {
  return e && e.__esModule ? e : { default: e };
}
Page({
  data: {
    background: "transparent",
    iconTheme: "white",
    position: !0,
    CDN: t.default.CDN,
    list: [
      {
        icon: "icon_star",
        name: "我的收藏",
        page: a.default.PAGE_MY_COLLECTION,
      },
      {
        icon: "icon_label-1",
        name: "我的订单",
        page: a.default.PAGE_MINE_ORDER,
      },
      {
        icon: "icon_warning-1",
        name: "投诉反馈",
        page: a.default.PAGE_COMPLAINT_LIST,
      },
      {
        icon: "Group1312315452",
        name: "智能客服",
        page: "".concat(
          a.default.PAGE_KEFU_TRANSFER,
          "?url=plugin://kefu/im-page",
        ),
      },
      {
        icon: "icon_setting",
        name: "账户设置",
        page: a.default.PAGE_ACCOUNT_SETTING,
      },
    ],
    mockList: [
      { icon: "icon_setting", name: "mock openid", page: "" },
      {
        icon: "icon_setting",
        name: "mock 研学教育",
        page: "".concat(
          a.default.PAGE_COURSE_TRANSFER,
          "?url=plugin://course/course-list",
        ),
      },
      {
        icon: "icon_setting",
        name: "mock 讲解订单",
        page: "/pages/transfer-explain/index?url=plugin://explain/order&isOrder=true",
      },
      {
        icon: "icon_setting",
        name: "mock 讲解预约",
        page: "/pages/transfer-explain/index?url=plugin://explain/scan&isScan=true",
      },
      {
        icon: "icon_setting",
        name: "mock 发票",
        page: "/pages/transfer-explain/index?url=plugin://explain/billEdit",
      },
      {
        icon: "icon_setting",
        name: "mock 知识图谱",
        page: a.default.PAGE_ZHISHI_SUBPACKEGE_HOME,
      },
      {
        icon: "icon_setting",
        name: "mock 定位",
        page: a.default.PAGE_LOCATION_MOCK,
      },
      {
        icon: "icon_setting",
        name: "aoa 定位测试",
        page: a.default.PAGE_LOCATION_AOA,
      },
      {
        icon: "icon_setting",
        name: "mock 地图导览",
        page: a.default.PAGE_TOUR_MAP_INDEX,
      },
      {
        icon: "icon_setting",
        name: "mock 地图路线",
        page: a.default.PAGE_TOUR_PATHS,
      },
      {
        icon: "icon_setting",
        name: "mock 讲解",
        page: "".concat(
          a.default.PAGE_EXPLAIN_TRANSFER,
          "?url=plugin://explain/home",
        ),
      },
      {
        icon: "icon_setting",
        name: "mock 导览",
        page: "".concat(
          a.default.PAGE_GUIDE_TRANSFER,
          "?url=plugin://guide/home",
        ),
      },
      { icon: "icon_setting", name: "mock 订单状态1", page: "order", val: 0 },
      { icon: "icon_setting", name: "mock 订单状态2", page: "order", val: 1 },
      { icon: "icon_setting", name: "mock 订单状态3", page: "order", val: 2 },
      { icon: "icon_setting", name: "mock 订单状态4", page: "order", val: 3 },
      {
        icon: "icon_feedback",
        name: "mock志愿报名",
        page: "".concat(
          a.default.PAGE_VOLUNTEER_TRANSFER,
          "?url=plugin://volunteer/activity-sign-in",
        ),
      },
      {
        icon: "icon_feedback",
        name: "mock培训签到",
        page: "".concat(
          a.default.PAGE_VOLUNTEER_TRANSFER,
          "?url=plugin://volunteer/train-sign-in",
        ),
      },
      {
        icon: "icon_feedback",
        name: "志愿服务",
        page: "".concat(
          a.default.PAGE_VOLUNTEER_TRANSFER,
          "?url=plugin://volunteer/non-volunteer-homepage",
        ),
      },
      {
        icon: "icon_setting",
        name: "mock 我的活动",
        page: "".concat(
          a.default.PAGE_COURSE_TRANSFER,
          "?url=plugin://course/my-activity-list",
        ),
      },
      {
        icon: "icon_setting",
        name: "mock 我的课程",
        page: "".concat(
          a.default.PAGE_COURSE_TRANSFER,
          "?url=plugin://course/my-course-list",
        ),
      },
      {
        icon: "icon_setting",
        name: "mock 活动列表",
        page: "".concat(
          a.default.PAGE_COURSE_TRANSFER,
          "?url=plugin://course/activity-list",
        ),
      },
      {
        icon: "icon_setting",
        name: "mock 课程列表",
        page: "".concat(
          a.default.PAGE_COURSE_TRANSFER,
          "?url=plugin://course/course-list",
        ),
      },
      {
        icon: "icon_setting",
        name: "mock  租赁订单1",
        page: "".concat(
          a.default.PAGE_GUIDE_TRANSFER,
          "?url=plugin://guide/home&isScan=true&partnerId=46",
        ),
      },
      {
        icon: "icon_setting",
        name: "mock 租赁订单2",
        page: "".concat(
          a.default.PAGE_GUIDE_TRANSFER,
          "?url=plugin://guide/home&isScan=true&partnerId=47",
        ),
      },
    ],
    isLogin: !1,
    userInfo: {},
    startTime: 0,
    come: "1",
    isDebug: !1,
  },
  onLoad: function () {
    var e = this;
    this.setData({ startTime: Date.now() }),
      wx.setNavigationBarColor({
        backgroundColor: "#ffffff",
        frontColor: "#ffffff",
      }),
      wx.getSystemInfoAsync({
        success: function (n) {
          e.setData({ isDebug: n.enableDebug });
        },
      });
  },
  onShareAppMessage: function () {
    return (
      this.setData({ come: "1" }),
      {
        title: t.default.share.title,
        imageUrl: t.default.share.pic,
        path: a.default.PAGE_MINE_INDEX,
      }
    );
  },
  onShow: function () {
    "function" == typeof this.getTabBar &&
      this.getTabBar() &&
      (this.getTabBar().setData({ selected: 3 }), this.getTabBar().play()),
      this.setData({
        isLogin: (0, i.getLoginStatus)(),
        userInfo: (0, i.getUserInfo)(),
      });
  },
  onHide: function () {
    var e = Date.now() - this.data.startTime;
    (0, o.report)("mpage_show", { time: e });
  },
  onUnload: function () {
    var e = Date.now() - this.data.startTime;
    (0, o.report)("mpage_show", { time: e });
  },
  onScroll: function (e) {
    e.detail.scrollTop > 60
      ? this.setData({ background: "#0C1411" })
      : this.setData({ background: "transparent" });
  },
  toDebugItem: function (t) {
    var a = t.currentTarget.dataset.item;
    return "order" === a.page
      ? (wx.setStorageSync("mock_status", a.val),
        void wx.showToast({ title: "设置成功", icon: "none", duration: 2500 }))
      : a.page
        ? void (0, n.navigateTo)(a.page, {})
        : (wx.setStorageSync(
            "san_main_login_info",
            e(
              e({}, wx.getStorageSync("san_main_login_info")),
              {},
              { openid: this.generateOpenID() },
            ),
          ),
          void wx.showToast({
            title: "设置成功",
            icon: "none",
            duration: 2500,
          }));
  },
  toItem: function (e) {
    var t = e.currentTarget.dataset,
      a = t.item,
      i = t.index,
      c = this.data.come;
    0 === i
      ? (0, o.report)("mpage_collect_click", {})
      : 1 === i
        ? (0, o.report)("mpage_clock_click", {})
        : 2 === i
          ? (0, o.report)("mpage_order_click", {})
          : 3 === i
            ? ((0, o.report)("mpage_service_click", {}),
              (0, o.report)("mpage_service_show", { source: c }))
            : 4 === i
              ? (0, o.report)("mpage_compliment_click", {})
              : 5 === i
                ? ((0, o.report)("mpage_callcenter_click", {}),
                  (0, o.report)("mpage_callcenter_show", { source: c }))
                : 6 === i && (0, o.report)("mpage_setting_click", {}),
      (0, n.navigateTo)(a.page, {});
  },
  generateOpenID: function () {
    var e = new Date().getTime(),
      n = Math.random().toString(36).substring(2);
    return "openid_".concat(e, "_").concat(n);
  },
  onLogin: function (e) {
    this.setData({ isLogin: !0, userInfo: e.detail });
  },
  toPerson: function () {
    (0, n.navigateTo)(a.default.PAGE_ACCOUNT_INFO, {});
  },
});
